﻿<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title>登录</title>
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/new_css/login.css" />
 <script type="text/javascript" src="<%=request.getContextPath() %>/jQuery/base/jquery-1.6.4.js"></script>
 <script type="text/javascript" src="<%=request.getContextPath() %>/jQuery/base/jquery.cookie.js"></script>
 <script type="text/javascript" src="<%=request.getContextPath() %>/jQuery/ui/jquery-ui-1.8.16.custom.min.js"></script>
 <script type="text/javascript">
      function processKeyDown(event) {
        var event = event ? event : window.event;
        if (event.keyCode == 13) {
          js_Login();
        }
      }
      function js_reset(){
    		$("#accountNo").val("");
    		$("#password").val("");
    	}
    	
    	function js_Login(){
        	 $.ajax({
    	         type : "POST",
    	         url : "register!login.do",
    	         data: $("#frmLogin").serialize(),
    	         dataType : "json",
    	         error : function() {},
    	         success : function(data, textStatus) {
    				var json = eval(data);
    				//alert(json.success);
    	           if (json.success) {
    	              // alert("登陆成功");
    	               //window.location.href="user!initUserPage.do";
    	        	   window.location.href="frame!welcome.do?type=frame";
    	             } else {
    	               alert("用户名或密码错误");
    	           }
    	         }
    	   });
    		
    	}
    </script>
  </head>
  <body>
     <div id="login_wrap">
    <div class="login_bg">
      <div class="login_inpfie">
          <form id="frmLogin">
          <p>
            <span>用户名</span>
            <input id="accountNo" name="user.accountNo" value="admin" type="text" class="name" />
            <br />
            <span>密&nbsp;&nbsp;&nbsp;码</span>
            <input name="user.userPassword" id="password" value="admin" type="password" class="pass" onkeydown="processKeyDown(event)"/>
            <br />
          </p>
          <div class="bnt_login_bg">
            <input type="button" value="登&nbsp;&nbsp;录" onclick="js_Login();" />
            <input type="button" value="重&nbsp;&nbsp;置" onclick="js_reset();" />
          </div>
        </form>
      </div>
    </div>
  </div>
  </body>
</html>

